home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14396 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can you printf a long
  5. Date: Sun, 14 Apr 96 10:53:40 GMT
  6. Organization: none
  7. Distribution: world
  8. Message-ID: <829479220snz@genesis.demon.co.uk>
  9. References: <4ju8o1$dc3@news.netam.net> <tsw-0804961302160001@cypher.3do.com>
  10. Reply-To: fred@genesis.demon.co.uk
  11. X-NNTP-Posting-Host: genesis.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.27
  13. X-Mail2News-Path: genesis.demon.co.uk
  14.  
  15. In article <tsw-0804961302160001@cypher.3do.com> tsw@3do.com "Tom Watson" writes:
  16.  
  17. >2)  The routine 'printf' is a routine that takes a variable number of
  18. >arguments, and as such goes thru "the usual argument promotions" for your
  19. >system.  While it may not be significant in all cases (read:
  20. >implementation defined), usually the argument is promoted to a 'double'
  21. >and its size (again: Implementation defined) is probably 8.
  22.  
  23. The "default argument promotions" are defined by the standard. The only
  24. relevant thing that is implementation defined are the values of INT_MAX,
  25. USHRT_MAX, CHAR_MAX and UCHAR_MAX which will determine whether unsigned short,
  26. char and unsigned char promote to int or unsigned int. float must always
  27. be promoted to double which is why %f is always the correct printf
  28. conversion specifier for both floats and doubles.
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.